﻿using Edge.Repository.Base;
using HYRN.Common.ConvertUtilities;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Edge.Repository.Model.ResistanceWelding
{

    #region 设备 

    [SqlSugar.SugarTable("RW_Equipment")]

    public class RW_Equipment : EdgeBaseModel
    {


        [SugarColumn(IsNullable = true)]
        public int Type { get; set; }


        [SugarColumn(IsNullable = true)]
        public string Name { get; set; }



        [SugarColumn(IsNullable = true)]
        public string Code { get; set; }



        [SugarColumn(IsNullable = true)]
        public string Remark { get; set; }


        [SugarColumn(IsNullable = true)]
        public string IpPort { get; set; }


        [SugarColumn(IsNullable = true)]
        public string Ip { get; set; }

        [SugarColumn(IsNullable = true)]
        public string TongXunFangShi { get; set; }


        [SugarColumn(IsNullable = true)]
        public string GongWei { get; set; }


        [SugarColumn(IsNullable = true)]
        public string ZaiXian { get; set; }


        [SugarColumn(IsNullable = true)]
        public string RuanJianBanBen { get; set; }


        [SugarColumn(IsNullable = true)]
        public string TongXunFangXiang { get; set; }


        [SugarColumn(IsNullable = true)]
        public string HanJieDianLiu { get; set; }


    }


    /// <summary>
    ///  设备 
    /// </summary>
    public class EquipmentService : BaseRepository<RW_Equipment>
    {
    }



    public class EquipmentDto
    {
        public int Id { get; set; }

        public int Type { get; set; }


        public string Name { get; set; }



        public string Code { get; set; }



        public string Remark { get; set; }


        public string IpPort { get; set; }


        public string Ip { get; set; }

        public string TongXunFangShi { get; set; }

        public string GongWei { get; set; }


        public string ZaiXian { get; set; }



        public string RuanJianBanBen { get; set; }



        public string TongXunFangXiang { get; set; }



        public string HanJieDianLiu { get; set; }


    }




    #endregion

    #region 寄存器 配置


    /// <summary>
    ///  寄存器 
    /// </summary>
    [SqlSugar.SugarTable("RW_JcqConfig")]
    public class RW_JcqConfig : EdgeBaseModel
    {

        [SugarColumn(IsNullable = true)]
        public int AppNo { get; set; }


        [SugarColumn(IsNullable = true)]
        public string AppVal { get; set; }

    }

    public class JcqConfigService : BaseRepository<RW_JcqConfig>
    {
    }

    #endregion

    #region 故障记录


    [SqlSugar.SugarTable("RW_ErrorRecord")]

    public class RW_ErrorRecord : EdgeBaseModel
    {
        [SugarColumn(IsNullable = true)]
        public int Index { get; set; }


        [SugarColumn(IsNullable = true)]
        public DateTime RecordTime { get; set; }

        [SugarColumn(IsNullable = true)]
        public string KzqName { get; set; }

        [SugarColumn(IsNullable = true)]
        public string KzqID { get; set; }

        [SugarColumn(IsNullable = true)]
        public string GuiFanHao { get; set; }

        [SugarColumn(IsNullable = true)]
        public string BaoJingCode { get; set; }

        [SugarColumn(IsNullable = true)]
        public string BaoJingRemark { get; set; }



    }


    public class RWErrorRecordService : BaseRepository<RW_ErrorRecord>
    {


    }
    #endregion

    #region 上报记录


    /// <summary>
    ///  上报记录 
    /// </summary>
    [SqlSugar.SugarTable("RW_ShangBao")]
    public class RW_ShangBao : EdgeBaseModel
    {
        [SugarColumn(IsNullable = true)]
        public string mySheBeiDaiMa { get; set; }

        [SugarColumn(IsNullable = true)]
        public DateTime myShangBaoShiJian { get; set; }

        [SugarColumn(IsNullable = true)]
        public string myData { get; set; }

    }


    public class ShangBaoDto
    {
        [SugarColumn(IsNullable = true)]
        public int Index { get; set; }

        [SugarColumn(IsNullable = true)]
        public string mySheBeiDaiMa { get; set; }

        [SugarColumn(IsNullable = true)]
        public DateTime myShangBaoShiJian { get; set; }

        [SugarColumn(IsNullable = true)]
        public string myShangBaoShiJianData { get; set; }
        //=====================
        //[SugarColumn(IsNullable = true)]
        //public int AppNo { get; set; }

        public DateTime MyDataTime
        {
            get
            {
                return (年 + "-" + 月 + "-" + 日 + " " + 时 + ":" + 分 + ":" + 秒).ObjToDate();
            }
        }

        #region 上报数据


        [SugarColumn(IsNullable = true)]
        public int 备用 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 年 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 月 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 日 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 时 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 分 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 秒 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 控制器名称 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 控制器ID { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 控制器IDA { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 焊点计数 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 规范号 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 焊接压力设定值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 预热模式设定值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 预热时间设定值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 预热电流设定值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 预热时间监控值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 预热电流监控值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 预热电流导通比 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 焊接模式设定值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 焊接时间设定值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 焊接电流设定值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 焊接时间监控值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 焊接电流监控值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 焊接电流导通比 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 回火模式设定值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 回火时间设定值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 回火电流设定值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 回火时间监控值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 回火电流监控值 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 回火电流导通比 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 焊接开始 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 焊接完成 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 上报完成 { get; set; }
        [SugarColumn(IsNullable = true)]
        public int 循环计数 { get; set; }



        #endregion

    }



    public class ShangBaoService : BaseRepository<RW_ShangBao>
    {

    }
    #endregion

    #region 设备上的寄存器配置记录


    /// <summary>
    ///  上报记录 
    /// </summary>
    [SqlSugar.SugarTable("RW_EquipJcqRecord")]
    public class RW_EquipJcqRecord : EdgeBaseModel
    {
        [SugarColumn(IsNullable = true)]
        public string EquipCode { get; set; }

        [SugarColumn(IsNullable = true)]
        public DateTime LogTime { get; set; }

        [SugarColumn(IsNullable = true)]
        public int CheXuHao { get; set; }

        [SugarColumn(IsNullable = true)]
        public string myData { get; set; }

    }




    public class RW_EquipJcqRecordService : BaseRepository<RW_EquipJcqRecord>
    {

    }
    #endregion


}
